//
//  PlayerInfoLineTableViewCell.m
//  NBAPro
//
//  Created by 李广松 on 16/7/13.
//  Copyright © 2016年 WYH. All rights reserved.
//

#import "PlayerInfoLineTableViewCell.h"

@implementation PlayerInfoLineTableViewCell

@synthesize titleLabel, lineView, dataLabel;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        titleLabel = [self createTitleLabelWithFrame:CGRectMake(12, 5.5, self.frame.size.width, 12)];
        [self addSubview:titleLabel];
        
        lineView = [self createLineViewWithFrame:CGRectMake(12, titleLabel.frame.origin.y + titleLabel.frame.size.height + 2.5, 0, 10)];
        [self addSubview:lineView];
        
        dataLabel = [self createTitleLabelWithFrame:CGRectMake(lineView.frame.origin.x + lineView.frame.size.width + 4, lineView.frame.origin.y, 50, 12)];
        [self addSubview:dataLabel];
    }
    
    
    return self;
}

- (UILabel *)createTitleLabelWithFrame:(CGRect)frame {
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.font = [UIFont systemFontOfSize:12];
    label.textColor = [UIColor colorWithRed:202/255.0 green:202/255.0 blue:202/255.0 alpha:1];
    label.textAlignment = NSTextAlignmentLeft;
    return label;
}

- (UIView *)createLineViewWithFrame:(CGRect)frame {
    UIView *view = [[UIView alloc] initWithFrame:frame];
    view.layer.cornerRadius = 5;
    
    if (frame.size.width > 375) {
        view.frame = CGRectMake(frame.origin.x, 0, 375, frame.size.height);
    }

    return view;
}



@end
